<div class="row m-n">
    <div class="crumbs-bar">
        <div yb-crumbs></div>
    </div>
    <div tabset type="tab">
        <div tab heading="逾期经销商" active="activeFlag[0]" ng-click="changeTab(0)">
            <div class="row wrapper-y-sm">
                <div class="operate-bar col-xs-4 font-0">
                    <!-- <button class="btn btn-operate m-r-sm" ng-click="addData()"  title="{{!btnPermission.storefrontAdd?'无权限执行此操作':''}}">新增</button>                     -->
                    <button class="btn btn-operate m-r-sm" ng-click="delData()">批量删除</button>                    
                </div>
                <div class="search-bar wrapper-none col-xs-8">
                    <div class="btn-group m-l-xs pull-right">
                        <button type="button" class="btn btn-default base-color" ng-click="search()" title="刷新">
                            <i class="yb-icon ico-refresh"></i>
                        </button>
                        <button type="button" class="btn btn-default base-color" title="配置表格列"
                                ng-click="switchToolbar('ColConfig');">
                            <i class="yb-icon ico-set"></i>
                        </button>
                        <button type="button"  class="btn btn-default base-color" ng-click="importDate()" title="导入">
                            <i class="yb-icon ico-import-o"></i>
                        </button>
                        <div class="btn btn-default base-color" >
                            <div title="导出" yb-download download-url="exportParam.allUrl" download-param="condition" download-duration="3">
                                <i class="yb-icon ico-export-o"></i>
                            </div>
                        </div>  
                    </div>
                    <button class="btn-advance pull-right m-l-xs" ng-click="switchToolbar('AdvanceSearch')">高级搜索</button>
                    <div class="input-group pull-right clearfix">
                        <input type="text" class="form-control txt-search" placeholder="经销商名称"
                               ng-model="condition.companyNameLike">
                        <span class="input-group-addon cursor-pointer" ng-click="search(1)">搜索</span>
                    </div>
                </div>
            </div>
            <div yb-advance-search show-toolbar="toolbarConfig.showAdvanceSearch" search-data="search(1)" reset-data="reset()">
                <div class="advance-search m-t-sm">
                    <div class="form-group clearfix">
                        <label class="control-label">经销商编码：</label>
                        <input type="text" class="form-control" placeholder="销商编码" ng-model="condition.dealerCodeLike">
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">是否逾期：</label>
                        <select class="form-control" ng-model="condition.overdue">
                            <option value="">请选择</option>
                            <option value="0">否</option>
                            <option value="1">是</option>
                        </select>                        
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">经销商名称：</label>
                        <input type="text" class="form-control" placeholder="经销商名称" ng-model="condition.companyNameLike">
                    </div>
                </div>
            </div>
            <div yb-col-config show-toolbar="toolbarConfig.showColConfig" ng-model="tableConfig" col-fixed="true" set-tb-style="setFixedWidth()"></div>
            <div class="main-area">
                <div yb-table-fixed class="table-fixed-wrap fix-left" ele-count="4" scroll-area="right">
                    <div class="th-fixed">
                        <table class="table-fixed border-none" width="{{tableConfig.fixedWidth}}">
                            <thead>
                            <tr>
                                <th width="40" class="th-check text-center border-l-none">
                                    <div yb-check-box yb-checked="markInfo.allChecked" yb-click="selectAll(dataList, 'Bill')"></div>
                                </th>
                                <th class="border-l-none" ng-repeat="itemCol in tableConfig.tableCol track by $index" width="{{itemCol.width}}"
                                    ng-click="toSort(tableConfig.tableCol, $index)" ng-show="!!itemCol.isShow && !!itemCol.isFixed">
                                    <div yb-thead-operate ng-model="itemCol" target-width="tableConfig.fixedWidth" fixed-width="tbStyle.billFixedWidth"></div>
                                </th>
                            </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="th-scroll-x" ng-style="tbStyle.billFixedWidth">
                        <table class="table-fixed border-none" width="{{tableConfig.scrollWidth}}">
                            <thead>
                            <tr>
                                <th ng-repeat="itemCol in tableConfig.tableCol track by $index" width="{{itemCol.width}}"
                                    ng-click="toSort(tableConfig.tableCol, $index)" ng-show="!!itemCol.isShow && !itemCol.isFixed">
                                    <div yb-thead-operate ng-model="itemCol" target-width="tableConfig.scrollWidth"></div>
                                </th>
                            </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="td-scroll-y" ng-show="dataList.length > 0">
                        <table class="table-fixed border-none" width="{{tableConfig.fixedWidth}}">
                            <tbody>
                            <tr ng-repeat="item in dataList track by $index" ng-class="{'row-selected': $index === markInfo.cueRow}"
                                ng-click="selectRow($index)">
                                <td width="40" class="text-center border-l-none">
                                    <div yb-check-box yb-checked="item.isChecked" yb-click="selectSingle(item, dataList)"></div>
                                </td>
                                <td class="spill-dots border-l-none" ng-repeat="itemCol in tableConfig.tableCol track by $index"
                                    width="{{itemCol.width}}" ng-show="!!itemCol.isShow && !!itemCol.isFixed"
                                    title="{{item[itemCol.dataField]}}">
                                    <span ng-if="!itemCol.clickFn && itemCol.type !== 'operate'">{{item[itemCol.dataField]}}</span>
                                    <a class="btn-operate m-r-xs" ng-click="tdClick(item, itemCol.clickFn)" ng-if="!!itemCol.clickFn">
                                        {{item[itemCol.dataField]}}
                                    </a>
                                    <div class="font-0" ng-if="itemCol.type === 'operate'">

                                        <button class="btn btn-operate m-r-xs" ng-click="editData(item)"
                                                title="{{!btnPermission.storefrontEdit?'无权限执行此操作':''}}">编辑</button>                                    
                                    </div>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="td-scroll" ng-show="dataList.length > 0" ng-style="tbStyle.billFixedWidth">
                        <table class="table-fixed border-none" width="{{tableConfig.scrollWidth}}">
                            <tbody>
                            <tr ng-repeat="item in dataList track by $index" ng-class="{'row-selected': $index === markInfo.cueRow}"
                                ng-click="selectRow($index)">
                                <td class="spill-dots" ng-repeat="itemCol in tableConfig.tableCol track by $index" width="{{itemCol.width}}"
                                    ng-show="!!itemCol.isShow && !itemCol.isFixed && itemCol.type !== 'totalLimit'"
                                    title="{{item[itemCol.dataField]}}">
                                    <span ng-if="!itemCol.clickFn && itemCol.type !== 'operate'">{{item[itemCol.dataField]}}</span>
                                    <a class="btn-operate m-r-xs" ng-click="tdClick(item, itemCol.clickFn)" ng-if="!!itemCol.clickFn">
                                        {{item[itemCol.dataField]}}
                                    </a>
                                </td>
                                <td class="spill-dots" ng-repeat="itemCol in tableConfig.tableCol track by $index" width="{{itemCol.width}}"
                                    ng-show="!!itemCol.isShow && !itemCol.isFixed && itemCol.type === 'totalLimit'"
                                    title="{{item[itemCol.dataField]}}">
                                    <input ng-disabled="item.enableLimit==0" yb-number-input class="safe-inventory-txt" type="text"
                                           ng-model="item.totalLimit" disable-decimal="false"
                                           decimal-places="3" max="9999999.999"
                                           ng-change="selectScheme()">
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="no-data w-full text-center p-t" ng-show="dataList.length === 0">暂时没有数据</div>
                </div>
            </div>
            <div class="bottom-area page-bar text-center wrapper-y-sm clearfix">
                <button class="btn btn-primary" ng-click="saveData()"
                        ng-disabled="!!btnEnabled || !btnPermission.dealerLimitSave" title="{{!btnPermission.dealerLimitSave?'无权限执行此操作':''}}">保存</button>
                <div yb-page-info ng-model="pageInfo" yb-refresh="search()"></div>
            </div>        
        </div>
        <div tab heading="{{tabFlag.name}}" active="activeFlag[1]" ng-if="activeFlag[1]">
            <form name="form" class="form-horizontal wrapper-md clearfix" novalidate>

                <div class="form-group">
                    <label class="col-xs-2 control-label"><i>*</i>经销商编码：</label>
                    <div class="col-xs-5 wrapper-none">
                        <input type="text" ng-required="!isJCH" ng-disabled="tabFlag.type === 1" yb-focus name="dealerCode" class="form-control" ng-model="detailInfo.dealerCode" maxlength="200">
                    </div>

                    <div class="col-xs-4 msg-block"
                         ng-show="form.dealerCode.$dirty || (form.dealerCode.$invalid && submitted)">
                        <div class="error-msg" ng-if="form.dealerCode.$error.required && !form.dealerCode.focused">
                            <i class="yb-icon ico-times-circular"></i>必填项，请填写
                        </div>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-xs-2 control-label"><i>*</i>经销商名称：</label>
                    <div class="col-xs-5 wrapper-none">
                        <input type="text" ng-disabled="tabFlag.type === 1" ng-required="!isJCH" yb-focus name="companyName" class="form-control" ng-model="detailInfo.companyName" maxlength="200">
                    </div>

                    <div class="col-xs-4 msg-block"
                         ng-show="form.companyName.$dirty || (form.companyName.$invalid && submitted)">
                        <div class="error-msg" ng-if="form.companyName.$error.required && !form.companyName.focused">
                            <i class="yb-icon ico-times-circular"></i>必填项，请填写
                        </div>
                    </div>
                </div>
                <div class="form-group m-b-sm">
                    <label class="col-xs-2 control-label">是否逾期：</label>
                    <label class="col-xs-5 control-label p-l-n text-left clearfix">
                        <input type="radio" class="m-r-sm pull-left" yb-radio
                               ng-model="detailInfo.overdue" value="1"
                               yb-radio-name="是">
                        <input type="radio" class="m-r-sm pull-left" yb-radio
                               ng-model="detailInfo.overdue" value="0"
                               yb-radio-name="否">
                    </label>
                </div>

                <div class="form-group">
                    <div class="col-xs-offset-2">
                        <button type="button" class="btn btn-primary m-r-sm" ng-click="saveData(form.$valid)">保存
                        </button>
                        <button type="button" class="btn btn-default" ng-click="changeTab(0)">取消</button>
                    </div>
                </div>
            </form>
        </div>            
    </div>
</div>